%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Batimento de duas frequências.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
figure(1);			clf;

w =2*pi*5;			k=1;			v=w/k;
t =[-2:.005:2];		x =[-6:.01:6]*2*pi;

for tt=1:length(t)
	x0=v*t(tt)*10*pi;
	phi=k*x-w*t(tt);	yp=-sin(phi) .* (phi>(-8*pi)) .* (phi<(8*pi));
	phi=k*x+w*t(tt);	ym= sin(phi) .* (phi>(-8*pi)) .* (phi<(8*pi));
	y =yp+ym;
	
	plot(x+40,y,'LineWidth',1.6)
	set(gca,'yLim',[-2 2],'FontSize',16,'LineWidth',1.4)
	xlabel('\fontsize{16}{\itt}')
	ylabel('\fontsize{16}{\itY}({\itx},{\itt})')
	pause(.01);
end

